
<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../resource/left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: <@s.m "resource.function"/> - <@s.m "global.edit"/></div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="button" value="<@s.m "global.backToList"/>" onclick="history.back();"/>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <@p.form id="baseForm" action="o_update.do" labelWidth="12" onsubmit="ajaxSubmit();return false;">
                        <@p.text label="resource.name" id="filename" name="filename" value=filename size="30" readonly="readonly"/>
                        <@p.textarea label="resource.content" id="content" name="content" value=content wrap="off" style="width:99%" rows="20" cols="70" maxlength="131072" help="resource.content.help" helpPosition="1" onkeydown="if((event.keyCode==115||event.keyCode==83)&&event.ctrlKey){ajaxSubmit();return false;}"/>
                        <@p.td>
                        <@p.submit code="global.submit"/> &nbsp; <@p.reset code="global.reset"/>
                    </@p.td>
                </@p.form>
            </div>
    </div>



    </div>

    </div>

<script type="text/javascript">
function ajaxSubmit() {
	$.post('o_update.do', {
		'name' : '${name!}',
		'content' : $('#content').val()
	}, function(data) {
		if (data) {
			alert("<@s.m 'global.success.save'/>");
		} else {
			alert("<@s.m 'global.failed.save'/>");
		}
	}, 'json');
}
</script>

</body>
</html>